var should = require('should');
var _ = require('lodash');
var smithyHandler = require('../../../app/servers/bag/handler/smithyHandler');
var bagModel = require('../../../app/models/bagModel');
var config = require('../../config');
var configUtil = require('../../../app/util/configUtil');
var analyze = require('kc-analyze');

suite('初始化', function () {
    test('analyze', function (done) {
        var analyze_config = configUtil.load('analyze');
        var game_config = configUtil.load('game');
        analyze.initialize({
            host: analyze_config.host,
            server_id: game_config.server_id
        });
        done();
    });
});

suite('测试smithyHandler', function () {
    suite('use', function () {
        test('初始化', function (done) {
            var analyze_config = configUtil.load('analyze');
            var game_config = configUtil.load('game');
            analyze.initialize({
                host: analyze_config.host,
                server_id: game_config.server_id
            });
            done();
        });

        //test('精力购买', function (done) {
        //var msg = {};
        //var session = {};
        //session.uid = config.role_id;

        //var smithy_handler = new smithyHandler();
        //smithy_handler.buy(msg, session, function (err, res) {
        //console.log('err:', err);
        //console.log('res:', res);
        //done();
        //});
        //});

        test('开始铁匠铺锻造', function (done) {
            var msg = {
                smithy_id: 1,
                worker_id: 1,
                worker_time: 14400
            };
            var session = {};
            session.uid = config.role_id;

            var smithy_handler = new smithyHandler();
            smithy_handler.start(msg, session, function (err, res) {
                //console.log('err:', err);
                //console.log('res:', res);
                done();
            });
        });

        //test('领取奖励', function (done) {
        //var msg = {
        //smithy_id: 1
        //};
        //var session = {};
        //session.uid = config.role_id;

        //var smithy_handler = new smithyHandler();
        //smithy_handler.receive(msg, session, function (err, res) {
        //console.log('err:', err);
        //console.log('res:', res);
        //done();
        //});
        //});

        //test('开启工匠槽', function (done) {
        //var msg = {
        //smithy_id: 3
        //};
        //var session = {};
        //session.uid = config.role_id;

        //var smithy_handler = new smithyHandler();
        //smithy_handler.open(msg, session, function (err, res) {
        //console.log('err:', err);
        //console.log('res:', res);
        //done();
        //});
        //});

        //test('直接完成精练', function (done) {
        //var msg = {
        //smithy_id: 1
        //};
        //var session = {};
        //session.uid = config.role_id;

        //var smithy_handler = new smithyHandler();
        //smithy_handler.direct(msg, session, function (err, res) {
        //console.log('err:', err);
        //console.log('res:', res);
        //done();
        //});
        //});
    });
});
